Paramiliar Design Studios Redefining Innovation and Excellence Design Services, website, build, cost effective, World Wide Web Consortium, browser compatability, website renovation

Client Login
Username
Password

Making Dynamic Links Search Engine Friendly

Posted By : mattyb 27th Oct 2006

Making Dynamic Links Search Engine Friendly

Before we can explain how to achieve this, we need to look into the reasons why and to explain one of the most common problems found with search engines and dynamic sites.

Problems with Dynamic sites and Search Engines

Dynamic pages SEO As many of you know, most dynamic pages use Query Strings.  Query Strings are shown in the site URL as follows.

http://www.site.com/thepage.php?this=1&is=7&query=string

So why does this cause a problem? Most Search Engine Spiders have trouble with query strings, for this reason most dynamic links will be ignored.

Using .htacces and mod_rewrite

Mod_rewrite is considered the Swiss Army Knife of URL manipulation; it allows you to show a URL that does not actually exist on your server and transform it on the server to the correct file.  So the link above could be shown as

http://www.paramiliar.com/thepage_1_7_string.html

This URL is very friendly to search engines, it is the kind of link they will eat and eat and eat until they are gauged on data.
So how do we achieve this? First, we must ensure the mod_rewrite module for Apache is installed. Now that we have checked the module is active, we can create an .htaccess file to handle the rewrite.
In our example above, we are changing:
thepage.php?this=1&is=7&query=string
To
thepage_1_7_string.html
To do this we use the following text in the .htaccess file
Code
1.
2.
RewriteEngine On
RewriteRule thepage_(.*)_(.*)_(.*).html thepage.php?this=$1&is=$2&query=$3 [L,NC]
Now to explain this,
Line 1 tells apache to turn the RewriteEngine On, this is what does the magic, it instructs Apache on the server to turn on the Rewrite Engine.
Line 2 is where the magic begins, first we declare that the line is a Rewrite Rule, second we tell it the file to expect, this is in the format of thepage_(.*)_(.*)_(.*).html so if we looked at thepage_firststring_secondstring_thirdstring.html we would load the values firststring, secondstring and thirdstring into the script. The second part of the line tells the RewriteEngine what file it is to translate it into. The $1, $2, $3 represent each (.*) section so if we translated this line we would come up with
Thepage_first_second_third.html
Thepage.php?this=first&is=second&query=third
So calling thepage_first_second_third.html would tell the server to execute thepage.php?this=first&is=second&query=third
This means a search engine could now index the html page while the server can show the dynamic content it wants to.
So those are the steps to take to make your dynamic unfriendly URL’s dynamic friendly ones which search engines will love.
But how can you utilise this in your links? Well instead of getting your Dynamic scripts to produce the link thepage.php?this=1&is=2&query=3 you would get the script to link to thepage_1_2_3.html instead!
So to recap on what you have learned, you have learnt of a common problem with search engines and dynamic sites, What mod_rewrite is and how to "Mask" the pages of your site to make them more dynamic.
Kind Regards
Matthew Bagley
Paramiliar Design Studios
http://www.paramiliar.com

AddThis Social Bookmark Button


Comments

 
Carl Varooqe (27th Oct 2006 @ 16:04.59)
Rated 5
I have always wondered how I could achieve this and now I know the answer, this is one of the biggest impacts on all my coding developments since I discovered databases!
 
:@ :) 8) :'( :)
:) :) :) :) :)
:) :) :) :) X(
Name
Website URL
Article Rating
1 bad , 5 good

1

2

3

4

5
Verification
Verification
Comments

Navigation

About Us
Free Articles
Testimonials
Privacy Statement
Design
Design Services
Design Pricing
Design Examples
Free Designs
Paid Designs
Website Design
Coding Services
Scripting Prices
Free Scripts
Paid Scripts
Request Scripting
Search Engines
What is SEO?
SEO Services
Pricing
Pay Per Click
Link Exchange
Request Optimisation
Request Advice
Portfolio
About the Company
Our Portfolio
Website Development
Website Applications
Graphic Design
Flash Design
View Clients
Services & Tools
Business Support
Services List
Who Is?
Sitemap Generator
Site Popularity Report

Members

Login

Latest Articles

FreeIndex - UK Web Designers Directory Resources - Link Exchange